class DeskActionSti < ActiveRecord::Migration
  def self.up
    create_table :desk_actions do |t|
      t.column :type, :string
      t.column :effective_at, :datetime, :null => false
      t.column :recorded_at, :datetime, :null => false
      t.column :recorded_by, :integer, :null =>  false
      t.column :destination, :string, :null => true
    end
    drop_table :entrances
    drop_table :exits
    drop_table :departures
    drop_table :jaunt_returns
  end

  def self.down
    create_table :entrances do |t|
      t.column :entrance_time, :datetime, :null => false
      t.column :recorded_at, :datetime, :null => false
      t.column :recorded_by, :integer, :null =>  false
    end
    create_table :exits do |t|
      t.column :exit_time, :datetime, :null => false
      t.column :recorded_at, :datetime, :null => false
      t.column :recorded_by, :integer, :null =>  false
      t.column :destination, :string, :null => false
    end  
    create_table :departures do |t|
      t.column :departure_time, :datetime, :null => false
      t.column :recorded_at, :datetime, :null => false
      t.column :recorded_by, :integer, :null =>  false
    end
    create_table :jaunt_returns do |t|
      t.column :return_time, :datetime, :null => false
      t.column :recorded_at, :datetime, :null => false
      t.column :recorded_by, :integer, :null =>  false
    end 
    drop_table :desk_actions
  end
end
